/******************************************************************************
 * * ui_inter_msg_interface.h - interface for internal message handling
 *
 * *(C) Copyright 2019 ASR International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef UI_INTER_MSG_INTERFACE_H
#define UI_INTER_MSG_INTERFACE_H

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    UI_SUB_MODULE_WATCH_UI = 0,
    UI_SUB_MODULE_MODEM_ADP,
    UI_SUB_MODULE_APP_ADP,
    UI_SUB_MODULE_NUM
} UI_SUB_MODULE_ID;

enum {
    UI_MSG_WATCH_UI_BASE            = 0,
    UI_MSG_MODEM_ADP_BASE           = 0x100,
    UI_MSG_APP_ADP_BASE             = 0x200,
    UI_MSG_BT_ADP_BASE              = 0x300,
    UI_MSG_QQ_ADP_BASE              = 0x400,
};
typedef uint16_t   UI_INTER_MSG_ID;

// extern Ui_Msg_Handler_t UiMsgHandler[UI_SUB_MODULE_NUM];
typedef void UI_Inter_Msg_t;

typedef struct
{
    uint16_t MsgId;
} UI_Inter_Msg_Header_t;

typedef struct
{
    UI_Inter_Msg_Header_t MsgHeader;
    UI_Inter_Msg_t *pMsg;
} UI_Os_Msg_t;

typedef VOID (*UI_Msg_Handler_t)(UI_INTER_MSG_ID MsgId, UI_Inter_Msg_t *Msg);                      // message handler call back function define

extern VOID UI_Msg_Handler_Bind(UI_Msg_Handler_t MsgHandler);
extern VOID UI_Send_Inter_Msg(UI_SUB_MODULE_ID Dest, UI_INTER_MSG_ID MsgId, UI_Inter_Msg_t *Msg);
extern UI_Os_Msg_t *UI_Rcv_Inter_Msg(VOID);

#ifdef __cplusplus
}
#endif
#endif
